package it.polito.ai.lhmf.orm;

// Generated 8-giu-2012 18.52.32 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Member generated by hbm2java
 */
@Entity
@Table(name = "member")
public class Member implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer idMember;
	private MemberType memberType;
	private MemberStatus memberStatus;
	private String name;
	private String surname;
	private String username;
	private String password;
	private String regCode;
	private Date regDate;
	private String email;
	private String address;
	private String city;
	private String state;
	private int cap;
	private String tel;
	private Set<Message> messagesForIdReceiver = new HashSet<Message>(0);
	private Set<Message> messagesForIdSender = new HashSet<Message>(0);
	private Set<Supplier> suppliers = new HashSet<Supplier>(0);
	private Set<Notify> notifies = new HashSet<Notify>(0);
	private Set<Log> logs = new HashSet<Log>(0);
	private Set<Order> orders = new HashSet<Order>(0);
	private Set<Purchase> purchases = new HashSet<Purchase>(0);

	public Member() {
	}

	public Member(MemberType memberType, MemberStatus memberStatus,
			String name, String surname, String username, String password,
			String regCode, Date regDate, String email, String address,
			String city, String state, int cap) {
		this.memberType = memberType;
		this.memberStatus = memberStatus;
		this.name = name;
		this.surname = surname;
		this.username = username;
		this.password = password;
		this.regCode = regCode;
		this.regDate = regDate;
		this.email = email;
		this.address = address;
		this.city = city;
		this.state = state;
		this.cap = cap;
	}

	public Member(MemberType memberType, MemberStatus memberStatus,
			String name, String surname, String username, String password,
			String regCode, Date regDate, String email, String address,
			String city, String state, int cap, String tel,
			Set<Message> messagesForIdReceiver, Set<Message> messagesForIdSender, Set<Supplier> suppliers,
			Set<Notify> notifies, Set<Log> logs, Set<Order> orders, Set<Purchase> purchases) {
		this.memberType = memberType;
		this.memberStatus = memberStatus;
		this.name = name;
		this.surname = surname;
		this.username = username;
		this.password = password;
		this.regCode = regCode;
		this.regDate = regDate;
		this.email = email;
		this.address = address;
		this.city = city;
		this.state = state;
		this.cap = cap;
		this.tel = tel;
		this.messagesForIdReceiver = messagesForIdReceiver;
		this.messagesForIdSender = messagesForIdSender;
		this.suppliers = suppliers;
		this.notifies = notifies;
		this.logs = logs;
		this.orders = orders;
		this.purchases = purchases;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "idMember", unique = true, nullable = false)
	public Integer getIdMember() {
		return this.idMember;
	}

	public void setIdMember(Integer idMember) {
		this.idMember = idMember;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "member_type", nullable = false)
	public MemberType getMemberType() {
		return this.memberType;
	}

	public void setMemberType(MemberType memberType) {
		this.memberType = memberType;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "status", nullable = false)
	public MemberStatus getMemberStatus() {
		return this.memberStatus;
	}

	public void setMemberStatus(MemberStatus memberStatus) {
		this.memberStatus = memberStatus;
	}

	@Column(name = "name", nullable = false, length = 45)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "surname", nullable = false, length = 45)
	public String getSurname() {
		return this.surname;
	}

	public void setSurname(String surname) {
		this.surname = surname;
	}

	@Column(name = "username", nullable = false, length = 45)
	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(name = "password", nullable = false, length = 32)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "reg_code", nullable = false, length = 64)
	public String getRegCode() {
		return this.regCode;
	}

	public void setRegCode(String regCode) {
		this.regCode = regCode;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "reg_date", nullable = false, length = 10)
	public Date getRegDate() {
		return this.regDate;
	}

	public void setRegDate(Date regDate) {
		this.regDate = regDate;
	}

	@Column(name = "email", nullable = false, length = 45)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "address", nullable = false, length = 45)
	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Column(name = "city", nullable = false, length = 45)
	public String getCity() {
		return this.city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	@Column(name = "state", nullable = false, length = 45)
	public String getState() {
		return this.state;
	}

	public void setState(String state) {
		this.state = state;
	}

	@Column(name = "cap", nullable = false)
	public int getCap() {
		return this.cap;
	}

	public void setCap(int cap) {
		this.cap = cap;
	}

	@Column(name = "tel", length = 45)
	public String getTel() {
		return this.tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "memberByIdReceiver")
	public Set<Message> getMessagesForIdReceiver() {
		return this.messagesForIdReceiver;
	}

	public void setMessagesForIdReceiver(Set<Message> messagesForIdReceiver) {
		this.messagesForIdReceiver = messagesForIdReceiver;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "memberByIdSender")
	public Set<Message> getMessagesForIdSender() {
		return this.messagesForIdSender;
	}

	public void setMessagesForIdSender(Set<Message> messagesForIdSender) {
		this.messagesForIdSender = messagesForIdSender;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "member")
	public Set<Supplier> getSuppliers() {
		return this.suppliers;
	}

	public void setSuppliers(Set<Supplier> suppliers) {
		this.suppliers = suppliers;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "member")
	public Set<Notify> getNotifies() {
		return this.notifies;
	}

	public void setNotifies(Set<Notify> notifies) {
		this.notifies = notifies;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "member")
	public Set<Log> getLogs() {
		return this.logs;
	}

	public void setLogs(Set<Log> logs) {
		this.logs = logs;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "member")
	public Set<Order> getOrders() {
		return this.orders;
	}

	public void setOrders(Set<Order> orders) {
		this.orders = orders;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "member")
	public Set<Purchase> getPurchases() {
		return this.purchases;
	}

	public void setPurchases(Set<Purchase> purchases) {
		this.purchases = purchases;
	}

}
